//
//  MBRecordController.m
//  MiBaoTu
//
//  Created by 彭鹏 on 16/9/21.
//  Copyright © 2016年 com.caesartech15. All rights reserved.
//

#import "MBRecordController.h"
#import "MBSpaceMyParentChildShowTabbarView.h"
#import "MBRecordCell.h"
#import "MBChildRecordController.h"
#import "MBSpaceMyParentChildShowViewController.h"
#import "MBRecordFreedomController.h"
#import "MBChildRecordForIController.h"
#import "CZSearchBar.h"
#import "MBSpaceSearchDataViewController.h"

@interface MBRecordController ()<UITableViewDataSource,UITableViewDelegate,MBSpaceMyParentChildShowTabbarViewDelegate,UITextFieldDelegate,MBRecordCellDelegate> {
    UITableView                 *_tableView;
    int                         indexCount;
    NSMutableArray              *_mutArr;
    
    UIView                      *_showderView;
    UIView                      *_inputView;
    UIButton                    *sureBt;
    float                       inputTime;
}
@property (nonatomic,assign)NSInteger   type;
@property (weak, nonatomic) IBOutlet UIView *btnView;
@property (nonatomic, strong) UITextField *searchBar;
@property (weak, nonatomic) IBOutlet UIImageView *headerImgView;


@property (strong, nonatomic) IBOutlet NSLayoutConstraint *recentlyRecordLeft;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *freedomRecordRight;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *btnHeight;
@property (strong, nonatomic) IBOutlet UIImageView *middleImageView;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *middleImgTop;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *middleImgHeight;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *BtnTop;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *recordBtnHeight;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *ferrdomBtnHeight;

@end

@implementation MBRecordController
//最近录过
- (IBAction)recentlyRecord:(id)sender {
    
    MBSpaceMyParentChildShowViewController *childShowVC = [[MBSpaceMyParentChildShowViewController alloc] init];
    [self.navigationController pushViewController:childShowVC animated:YES];
}
//随便录下
- (IBAction)recordFreedom:(id)sender {
    
    MBRecordFreedomController *recordFreemdomVC = [[MBRecordFreedomController alloc] init];
    [self.navigationController pushViewController:recordFreemdomVC animated:YES];
    
}


- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:NO];
     [self registerForKeyboardNotifications];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    [self removeForkeyboardNotifications];
}

- (void)viewDidLoad {
    [super viewDidLoad];
   
    indexCount = 1;
    _type = 0;
    _mutArr = [[NSMutableArray alloc]init];
    
    //value show this ,no bibi bo die
    [self setBackItem];
    [self onCreateUI];
    [self onLoadNew];
    [self onLoadBgImgView];
}

- (void)setBackItem
{
    UIImage *img = [UIImage imageNamed:@"fanhui"];
    UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom];
    back.frame = CGRectMake(25*PERCEN, 20+(44-img.size.height)/2., 20, img.size.height);
    [back setImage:img forState:UIControlStateNormal];
    [back setImage:img forState:UIControlStateHighlighted];
    [back setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 20-img.size.width)];

    [back addTarget:self action:@selector(onBack) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:back];

    UIImage *imgLive = [UIImage imageNamed:@"bofang1-1"];
    UITextField *searchBar = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(back.frame)+20*PERCEN, 27, SCREEN_WIDTH-25*PERCEN-imgLive.size.width-CGRectGetMaxX(back.frame)-40*PERCEN, 60*PERCEN)];
    searchBar.backgroundColor = [UIColor whiteColor];
    searchBar.placeholder = @" 搜索";
    searchBar.font = [UIFont systemFontOfSize:14];
    [searchBar setValue:searchBar.font forKeyPath:@"_placeholderLabel.font"];
    searchBar.textColor = UIColorFromHex(0x999999);
    searchBar.delegate = self;
    searchBar.borderStyle = UITextBorderStyleRoundedRect;
    [self.view addSubview:searchBar];
    self.searchBar = searchBar;
    
    AVPlayer *player = (AVPlayer *)[UserManager standerDefult].mainPlayer;
    NSMutableArray *mutArr = [[NSMutableArray alloc]init];
    for (int i=1; i<=4; i++) {
        UIImage *img = [UIImage imageNamed:[NSString stringWithFormat:@"bofang1-%d",i]];
        [mutArr addObject:img];
    }
    
    UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
    bt.frame = CGRectMake(SCREEN_WIDTH-25*PERCEN-imgLive.size.width, back.top, imgLive.size.width, imgLive.size.height);
    [bt addTarget:self action:@selector(onPlayMusic) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *_liveImgView = [[UIImageView alloc]initWithFrame:CGRectMake((bt.width-imgLive.size.width), (bt.height-imgLive.size.height)/2., imgLive.size.width, imgLive.size.height)];
    _liveImgView.backgroundColor = [UIColor clearColor];
    _liveImgView.image = imgLive;
    _liveImgView.animationImages = mutArr;
    _liveImgView.animationDuration = .6;
    _liveImgView.animationRepeatCount = MAXFLOAT;
    
    [bt addSubview:_liveImgView];
    
    _middleImgHeight.constant=SCREEN_WIDTH/375.0*150;
    
    if (player) {
        if ([UserManager standerDefult].isPlaying) {
            [_liveImgView startAnimating];
        } else {
            [_liveImgView stopAnimating];
        }
    } else {
        [_liveImgView stopAnimating];
    }
    [self.view addSubview:bt];
    
    
    if (ISIPAD) {
        _recentlyRecordLeft.constant = 440*PERCEN;
        _freedomRecordRight.constant = 440*PERCEN;
        _btnHeight.constant = 200*PERCEN;
        _recordBtnHeight.constant = 140*PERCEN;
        _ferrdomBtnHeight.constant = 140*PERCEN;
         self.automaticallyAdjustsScrollViewInsets = NO;
        UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 27, SCREEN_WIDTH, 30)];
        titleLable.text = @"发布亲子秀";
        titleLable.textAlignment = NSTextAlignmentCenter;
        titleLable.textColor = [UIColor whiteColor];
        [self.view addSubview:titleLable];
        UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, 110*PERCEN)];
        contentView.backgroundColor = [UIColor whiteColor];
        [self.view addSubview:contentView];
        
        searchBar.frame = CGRectMake(44*PERCEN , 20*PERCEN, SCREEN_WIDTH-2*44*PERCEN, 70*PERCEN);
        searchBar.textAlignment = NSTextAlignmentLeft;
        searchBar.placeholder = @"歌曲 专辑 亲子秀";
        
        UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sousuo2"]];
        imageV.width +=SCREEN_WIDTH/2-150*PERCEN;
        imageV.contentMode = UIViewContentModeRight;
        searchBar.leftView = imageV;
        // 一定要设置，想要显示搜索框左边的视图，一定要设置左边视图的模式
        searchBar.leftViewMode = UITextFieldViewModeAlways;
        [contentView addSubview:searchBar];
        _middleImgTop.constant = 110*PERCEN;
        _middleImgHeight.constant = 500*PERCEN;
        
    }
    
}


#pragma mark - Actions
- (void)onBack
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)onSendQZShowAction
{
    NSLog(@"跳转到播放页面");
}

#pragma mark - Actions
- (void)onCreateUI
{
    //神奇的两行神代码
     [self.view setNeedsLayout];
     [self.view layoutSubviews];
    float heith = 0;
        MBSpaceMyParentChildShowTabbarView *tabbarView = [[MBSpaceMyParentChildShowTabbarView alloc]initWithFrame:CGRectMake(0, self.btnView.bottom+20*PERCEN, SCREEN_WIDTH, 80*PERCEN) withCount:@[@"热门",@"首发"] withbgColor:[UIColor blackColor] withSelectColor:TINK_BG_COLOR];
        tabbarView.delegate = self;
        [self.view addSubview:tabbarView];
        heith = 80*PERCEN;
        
    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,(heith > 0 ? 80*PERCEN+self.btnView.bottom+20*PERCEN : 0), SCREEN_WIDTH, SCREEN_HEIGHT-(heith > 0 ? 80*PERCEN+self.btnView.bottom+20*PERCEN : 0)) style:UITableViewStylePlain];
    
    if (ISIPAD) {
        
        tabbarView.frame = CGRectMake(0, 64+810*PERCEN, SCREEN_WIDTH, 100*PERCEN);
        
        _tableView.frame = CGRectMake(0, 64+940*PERCEN, SCREEN_WIDTH, SCREEN_HEIGHT-(64+940*PERCEN));
        
      
    }
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tableView.backgroundColor = [UIColor clearColor];
    _tableView.backgroundView = nil;
    [self.view addSubview:_tableView];
    [_tableView addLegendHeaderWithRefreshingTarget:self refreshingAction:@selector(onLoadNew)];
    [_tableView addLegendFooterWithRefreshingTarget:self refreshingAction:@selector(onLoadMore)];
    
    //键盘
    _inputView = [[UIView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, 40)];
    _inputView.backgroundColor = UIColorFromHex(0xf5f5f5);
    _inputView.hidden = YES;
    [[UIApplication sharedApplication].keyWindow addSubview:_inputView];
    
    sureBt = [UIButton buttonWithType:UIButtonTypeCustom];
    sureBt.backgroundColor = [UIColor clearColor];
    sureBt.frame = CGRectMake(_inputView.width - 50, 0, 50, _inputView.height);
    [sureBt setTitle:@"搜索" forState:UIControlStateNormal];
    [sureBt setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    sureBt.titleLabel.font = [UIFont systemFontOfSize:13.f];
    [sureBt addTarget:self action:@selector(onSelectSureAction) forControlEvents:UIControlEventTouchUpInside];
    [_inputView addSubview:sureBt];
    
    _showderView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 216 - 40)];
    _showderView.backgroundColor = [UIColorFromHex(0x000000) colorWithAlphaComponent:.2];
    _showderView.hidden = YES;
    _showderView.userInteractionEnabled = YES;
    [[UIApplication sharedApplication].keyWindow addSubview:_showderView];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onTapHideInputAction)];
    [_showderView addGestureRecognizer:tap];
}

#pragma mark -加载数据
- (void)loadData
{

    NSString *url = @"";
    if (self.type == 0) {
        //热门
        url = [NSString stringWithFormat:FAMILYSHOW_RECORD_LIST_URL_PATH,[NSString stringWithFormat:@"%d",indexCount],@1,@""];
    } else {
        url = [NSString stringWithFormat:FAMILYSHOW_RECORD_LIST_URL_PATH,[NSString stringWithFormat:@"%d",indexCount],@2,@""];
    }
    [MBProgressHUD showHUDAddedTo:_tableView animated:YES];
    [[HTTPManager standerDefault]AFGetRequest:url view:nil success:^(NSDictionary *json) {
        [_tableView.header endRefreshing];
        [_tableView.footer endRefreshing];
        [MBProgressHUD hideHUDForView:_tableView animated:YES];
        
        if ([json isKindOfClass:[NSDictionary class]]) {
            if ([json[@"ret_code"] integerValue]==0) {
                NSArray *arr = json[@"data"];
                if (arr.count > 0) {
                    if (indexCount == 1) {
                        [_mutArr removeAllObjects];
                    }
                    
                    [_mutArr addObjectsFromArray:arr];
                }
                [_tableView reloadData];
            }
        }
    } failure:^(NSError *error) {
        [_tableView.header endRefreshing];
        [_tableView.footer endRefreshing];
        [MBProgressHUD hideHUDForView:_tableView animated:YES];
    }];
    
}

- (void)onLoadNew
{
    indexCount = 1;
    [self loadData];
}

- (void)onLoadMore
{
    ++indexCount;
    [self loadData];
}

//加载背景图片
- (void)onLoadBgImgView
{
    [[HTTPManager standerDefault]AFGetRequest:[NSString stringWithFormat:STORY_BACKGROUND_URL_PATH,@6] view:nil success:^(NSDictionary *json) {
        
        if ([json isKindOfClass:[NSDictionary class]]) {
            if ([json[@"ret_code"] integerValue]==0) {
                NSArray *arr = json[@"data"];
                if (arr.count > 0) {
                    NSDictionary *dic = [arr lastObject];
                    NSString *urlPath = [dic objectForKey:@"PicPath"];
                    UIImage *img = [UIImage imageNamed:@"banner2"];
                    if (ISIPAD) {
                        urlPath = [dic objectForKey:@"PicPath2"];
                        img = [UIImage imageNamed:@"banner2I"];
                    }
                    if (![urlPath isKindOfClass:[NSNull class]]) {
                        [_headerImgView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",MUSIC_PLAY_Url,urlPath]] placeholderImage:img];
                        [_tableView reloadData];
                    } else {
                        _headerImgView.image = img;
                    }
                }
                
            }
        }
    } failure:^(NSError *error) {
   
    }];

}

#pragma mark - 录制
- (void)onSelectItemForRecordQinZiXiu:(NSDictionary *)value
{
    if ([value isKindOfClass:[NSDictionary class]]) {
        NSString *lrcPath = [value objectForKey:@"Content"];
        
//        NSString *AudioName = [value objectForKey:@"AudioName"];
//        AudioName = [AudioName componentsSeparatedByString:@"."][0];
//        NSString *lrcString;
//        if (![lrcPath isKindOfClass:[NSNull class]] && AudioName.length > 0) {
//            //音频歌词下载
//            NSString *path = [NSString stringWithFormat:@"%@%@",MUSIC_PLAY_Url,lrcPath];
//            path = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
//            NSURL *url = [NSURL URLWithString:path];
//            NSData *date = [NSData dataWithContentsOfURL:url];
//            lrcString = [[NSString alloc]initWithData:date encoding:NSUTF8StringEncoding];
//            if (lrcString.length == 0) {
//                unsigned long encode = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
//                lrcString = [[NSString alloc] initWithData:date encoding:encode];
//            }
//
//        }
        
        if (ISIPAD) {
            MBChildRecordForIController *childRecordVC = [[MBChildRecordForIController alloc]init];
            childRecordVC.lrcString = lrcPath;
            childRecordVC.dataDic = value;
            [self.navigationController pushViewController:childRecordVC animated:YES];
        }else{
            MBChildRecordController *childRecordVC = [[MBChildRecordController alloc]init];
            childRecordVC.lrcString = lrcPath;
            childRecordVC.dataDic = value;
            [self.navigationController pushViewController:childRecordVC animated:YES];
        }

    }
}

#pragma mark - 选择器
- (void)onSelectItemForView:(MBSpaceMyParentChildShowTabbarView *)view withIndex:(NSInteger)selectIndex
{
    if (selectIndex < 2) {
        self.type = (int)selectIndex;
        [self onLoadNew];
    }
}

//键盘相关
- (void)registerForKeyboardNotifications
{
    //使用NSNotificationCenter 鍵盤出現時
    [[NSNotificationCenter defaultCenter] addObserver:self
     
                                             selector:@selector(keyboardWasShow:)
     
                                                 name:UIKeyboardWillShowNotification object:nil];
    
    //使用NSNotificationCenter 鍵盤隐藏時
    [[NSNotificationCenter defaultCenter] addObserver:self
     
                                             selector:@selector(keyboardWillBeHidden:)
     
                                                 name:UIKeyboardWillHideNotification object:nil];
    
    
}

- (void)removeForkeyboardNotifications
{
    [[NSNotificationCenter defaultCenter]removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter]removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}

- (void)keyboardWasShow:(NSNotification*)aNotification
{
    NSDictionary* info = [aNotification userInfo];
    CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
    float keyboardhight = 0;
    if(kbSize.height == 216)
    {
        keyboardhight = 0;
    }
    else
    {
        keyboardhight = kbSize.height-216;   //258 - 216 系统键盘的两个不同高度
    }
    //输入框位置动画加载
    inputTime = [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
    [self onAnimationWithInputView:NO WithHeight:keyboardhight WithDuration:inputTime];
}

//当键盘隐藏的时候
- (void)keyboardWillBeHidden:(NSNotification*)aNotification
{
    //do something
    [self onAnimationWithInputView:YES WithHeight:0 WithDuration:inputTime];
}

-(void)textViewDidEndEditing:(UITextView *)textView
{
    [self onAnimationWithInputView:YES WithHeight:0 WithDuration:inputTime];
    
    //释放
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}

//输入框和遮挡层动画效果
- (void)onAnimationWithInputView:(BOOL)isHidden WithHeight:(float)heght WithDuration:(float)time
{
    [UIView animateWithDuration:time animations:^{
        _inputView.top = (isHidden == YES ? SCREEN_HEIGHT : SCREEN_HEIGHT-216-heght-40);
        _inputView.hidden = isHidden;
        _showderView.hidden = isHidden;
        _showderView.height = _inputView.top;
    } completion:^(BOOL finished) {
        if (finished) {
            _searchBar.text = @"";
        }
    }];
}

- (void)onTapHideInputAction
{
    [_searchBar resignFirstResponder];
    [self onAnimationWithInputView:YES WithHeight:0 WithDuration:inputTime];
}

//发送回复信息
- (void)onSelectSureAction
{
    [self onTapHideInputAction];
    
    if (_searchBar.text.length > 0) {
        [self onTurnToController:_searchBar.text];
    }
}

#pragma mark - return隐藏键盘
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    
    if (textField.text.length > 0) {
        [self onTurnToController:textField.text];
    }
    
    return YES;
}

- (void)onTurnToController:(NSString *)text
{
    //插入数据入数据库
    UserModel *model = [UserManager standerDefult].userModel;
    if (model) {
        FMManageObject *manager = [FMManageObject standerDefault];
        NSArray *arr = [manager SelectTableBySearchHistoryWithContent:[NSString stringWithFormat:@"%@",text] withName:[NSString stringWithFormat:@"%@",model.UserID]];
        if (arr.count == 0) {
            arr = [manager onSelectSearchHistoryCount];
            [[FMManageObject standerDefault]insertTableBySearchHistoryWithId:[NSString stringWithFormat:@"%d",(int)arr.count+1] withName:[NSString stringWithFormat:@"%@",model.UserID] withContent:text];
        }
    }
    
    MBSpaceSearchDataViewController *collection = [[MBSpaceSearchDataViewController alloc]init];
    collection.textString = text;
    [self.navigationController pushViewController:collection animated:YES];
}

#pragma mark - UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _mutArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    static NSString *identify = @"MBRecordCell";
    MBRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"MBRecordCell" owner:self options:nil] lastObject];
        cell.delegate = self;
    }

    if (ISIPAD) {

        cell.imgLeft.constant = 440*PERCEN*(self.orientation==UIDeviceOrientationPortrait?1.0*SCREEN_WIDTH/SCREEN_HEIGHT:1.);
        cell.recordRight.constant = 440*PERCEN*(self.orientation==UIDeviceOrientationPortrait?1.0*SCREEN_WIDTH/SCREEN_HEIGHT:1.);
        cell.lineViewLeft.constant = 440*PERCEN*(self.orientation==UIDeviceOrientationPortrait?1.0*SCREEN_WIDTH/SCREEN_HEIGHT:1.);
        cell.lineViewRight.constant = 440*PERCEN*(self.orientation==UIDeviceOrientationPortrait?1.0*SCREEN_WIDTH/SCREEN_HEIGHT:1.);
        cell.lineView.backgroundColor = [UIColor lightGrayColor];
        
    }
    
    if (_mutArr.count > indexPath.row) {
        cell.dateDic = [_mutArr objectAtIndex:indexPath.row];
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (_mutArr.count > indexPath.row) {
        
        NSDictionary *value = [_mutArr objectAtIndex:indexPath.row];
        
        if ([value isKindOfClass:[NSDictionary class]]) {
            NSString *lrcString = [value objectForKey:@"Content"];
//            NSString *AudioName = [value objectForKey:@"AudioName"];
//            AudioName = [AudioName componentsSeparatedByString:@"."][0];
//            NSString *lrcString;
//            if (![lrcPath isKindOfClass:[NSNull class]] && AudioName.length > 0) {
//                //音频歌词下载
//                NSString *path = [NSString stringWithFormat:@"%@%@",MUSIC_PLAY_Url,lrcPath];
//                path = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
//                NSURL *url = [NSURL URLWithString:path];
//                NSData *date = [NSData dataWithContentsOfURL:url];
//                lrcString = [[NSString alloc]initWithData:date encoding:NSUTF8StringEncoding];
//                if (lrcString.length == 0) {
//                    unsigned long encode = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
//                    lrcString = [[NSString alloc] initWithData:date encoding:encode];
//                }
//                
//            }
            
            if (ISIPAD) {
                MBChildRecordForIController *childRecordVC = [[MBChildRecordForIController alloc]init];
                childRecordVC.lrcString = lrcString;
                childRecordVC.dataDic = value;
                [self.navigationController pushViewController:childRecordVC animated:YES];
            }else{
                MBChildRecordController *childRecordVC = [[MBChildRecordController alloc]init];
                childRecordVC.lrcString = lrcString;
                childRecordVC.dataDic = value;
                [self.navigationController pushViewController:childRecordVC animated:YES];
            }
            
        }
    }
   
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 60;
}

@end
